package system

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type Site_messageRouter struct{}

func (s *Site_messageRouter) InitSite_messageRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	site_messageRouter := Router.Group("site_message").Use(middleware.OperationRecord())
	site_messageRouterWithoutRecord := Router.Group("site_message")
	site_messageRouterWithoutAuth := PublicRouter.Group("site_message")
	{
		site_messageRouter.POST("createSite_message", site_messageApi.CreateSite_message)
		site_messageRouter.DELETE("deleteSite_message", site_messageApi.DeleteSite_message)
		site_messageRouter.DELETE("deleteSite_messageByIds", site_messageApi.DeleteSite_messageByIds)
		site_messageRouter.PUT("updateSite_message", site_messageApi.UpdateSite_message)
	}
	{
		site_messageRouterWithoutRecord.GET("findSite_message", site_messageApi.FindSite_message)
		site_messageRouterWithoutRecord.GET("getSite_messageList", site_messageApi.GetSite_messageList)
	}
	{
		site_messageRouterWithoutAuth.GET("getSite_messagePublic", site_messageApi.GetSite_messagePublic)
		site_messageRouterWithoutAuth.GET("getUserMessages", site_messageApi.GetUserMessages)
		site_messageRouterWithoutAuth.POST("markMessageRead", site_messageApi.MarkMessageRead)
		site_messageRouterWithoutAuth.POST("batchMarkRead", site_messageApi.BatchMarkRead)
		site_messageRouterWithoutAuth.POST("batchDelete", site_messageApi.BatchDelete)
		site_messageRouterWithoutAuth.POST("allMarkRead", site_messageApi.AllMarkRead)
		site_messageRouterWithoutAuth.POST("allDelete", site_messageApi.AllDelete)
		// WebSocket路由
		site_messageRouterWithoutAuth.GET("ws", site_messageApi.WebSocketHandler)
	}
}
